Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2]feat(2695): Does not overwrite PR comment that from other PR job #206

Merged
merged 2 commits into from
Jun 10, 2022

Conversation

itleigns
Copy link
Contributor

@itleigns itleigns commented Jun 9, 2022

Context

If multiple jobs have PR comments, the later job's comment overwrites the earlier job's comment.

Objective

We change so that PR comments are only edited by the same job in the same pipeline.

References

https://docs.github.com/ja/rest/issues/comments#list-issue-comments
screwdriver-cd/screwdriver#2695
Reflect the following PRs before reflecting this.

License

I confirm that this contribution is made under the terms of the license found in the root directory of this repository's source tree and that I have the authority necessary to make this contribution on behalf of its copyright owner.

index.js Outdated
const botComment = prComments.comments.find(
commentObj =>
commentObj.user.login === this.config.username &&
commentObj.body.split(/\n/)[0].match(/^.+pipelines\/(\d+)\/builds.+ ([\w-:]+)$/) &&
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might be easier to read if it's saved as a variable
but not blocking

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I stored the regular expression in a global variable.

@tkyi tkyi merged commit d3cd42a into screwdriver-cd:master Jun 10, 2022
@sd-buildbot
Copy link

🎉 This PR is included in version 11.10.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@itleigns itleigns deleted the pr-comment branch June 13, 2022 01:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants